﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MensUnoShop.Models
{
    public class Specification
    {
        private Guid _spguid;
        private Guid _pdguid;
        private string _title;
        private int _titletagid;
        private int _stock;
        private bool _spstatus;

        public Guid SID { set { _spguid = value; } get { return _spguid; } }
        public Guid PDGUID { set { _pdguid = value; } get { return _pdguid; } }
        public string TITLE { set { _title = value; } get { return _title; } }
        public int TITLETAGID { set { _titletagid = value; } get { return _titletagid; } }
        public int STOCK { set { _stock = value; } get { return _stock; } }
        public bool SPSTATUS { set { _spstatus = value; } get { return _spstatus; } }

        public void UpdateStock(int newstock)
        {
            DBMarket dbm = new DBMarket();
            dbm.UpdateSpecStock(_spguid, newstock);
        }

        public void UpdateStatus()
        {
            DBProduct dbp = new DBProduct();
            dbp.UpdateSpecificationStatus(this);
        }

        public void Update()
        {
            DBProduct dbp = new DBProduct();
            dbp.UpdateSpecification(this);
        }
    }
}
